package optimization.aco.config;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import optimization.config.AbstactOptimizationConfig;

/**
 * 
 * @author Daniil Chivilikhin
 *
 */
public class AntColonyOptimizationConfig extends AbstactOptimizationConfig {
	private Properties properties;
	
	public AntColonyOptimizationConfig(String configFileName) {
		try {
			properties = new Properties();
			properties.load(new FileInputStream(new File(configFileName)));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public double evaporationRate() {
		return Double.parseDouble(properties.getProperty("evaporation-rate"));
	}
	
	public int stagnationNumber() {
		return Integer.parseInt(properties.getProperty("stagnation-number"));
	}
	
	public int numberOfBestAutomatas() {
		return Integer.parseInt(properties.getProperty("number-of-best-automatas"));
	}
	
	public double minPheromoneValueCoefficient() {
		return Double.parseDouble(properties.getProperty("min-pheromone-value-coefficient"));
	}
	
	public int numberOfNFAStates() {
		return Integer.parseInt(properties.getProperty("number-of-nfa-states"));
	}
}
